﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WMS.Domain
{
    /// <summary>
    /// 已发货订单明细表
    /// </summary>
    public class ShippedOrderDetail
    {
        /// <summary>
        /// 主键
        /// </summary>
        [Key]
        public int Id { get; set; }

        /// <summary>
        /// 关联的已发货订单ID
        /// </summary>
        [Required]
        public int ShippedOrderId { get; set; }

        /// <summary>
        /// SKU (产品编码)
        /// </summary>
        [Required]
        [MaxLength(100)]
        public string SKU { get; set; }

        /// <summary>
        /// 产品名称
        /// </summary>
        [Required]
        [MaxLength(200)]
        public string ProductName { get; set; }

        /// <summary>
        /// 出库价格
        /// </summary>
        [Column(TypeName = "decimal(18,2)")]
        public decimal OutboundPrice { get; set; }

        /// <summary>
        /// 出库数量
        /// </summary>
        [Required]
        public int Quantity { get; set; }

        /// <summary>
        /// FNSKU (亚马逊产品标识符)
        /// </summary>
        [MaxLength(100)]
        public string FNSKU { get; set; }

        /// <summary>
        /// 指定单号
        /// </summary>
        [MaxLength(100)]
        public string DesignatedOrderNumber { get; set; }

        /// <summary>
        /// SKU修改 (修改次数或修改状态)
        /// </summary>
        public int SKUModified { get; set; }

        /// <summary>
        /// SKU数量 (可能是修改后的数量)
        /// </summary>
        public int SKUQuantity { get; set; }

        /// <summary>
        /// 收件人 (可能是分配的收件人)
        /// </summary>
        [MaxLength(100)]
        public string AssignedRecipient { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [MaxLength(500)]
        public string Remark { get; set; }

        /// <summary>
        /// 产品规格
        /// </summary>
        [MaxLength(100)]
        public string Specification { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        [MaxLength(20)]
        public string Unit { get; set; }

        /// <summary>
        /// 批次号
        /// </summary>
        [MaxLength(50)]
        public string BatchNumber { get; set; }

        /// <summary>
        /// 单个产品重量(KG)
        /// </summary>
        public decimal Weight { get; set; }

        /// <summary>
        /// 产品总重量(KG)
        /// </summary>
        public decimal TotalWeight { get; set; }

        // 导航属性
        /// <summary>
        /// 关联的已发货订单
        /// </summary>
        [ForeignKey("ShippedOrderId")]
        public virtual ShippedOrder ShippedOrder { get; set; }
    }

}
